{include file="public/header" /}
<link rel="stylesheet" href="/static/index/css/draw.css">
<style>
    .draw-to-list {
        background-color: #fff !important;
    }
</style>
<body style="padding-top: 0">
<ul class="draw-to-list">
    <li data-type="{if $user.alipay_image && $user.alipay_name}支付宝{/if}">
        <div class="top">
            <p class="flex-center">
                <img src="/static/index/img/alipay.png" alt="">
            </p>
            <p class="center">支付宝</p>
            <label for="check">
                <img src="/static/index/img/not-check.png" alt="">
            </label>
            <input type="radio" id="check">
        </div>
        <div class="news">
            <p>姓名：{:substrCut($user.alipay_name)}</p>
        </div>
    </li>
    <li data-type="{if $user.wechat_name && $user.wechat_image}微信{/if}">
        <div class="top">
            <p class="flex-center">
                <img src="/static/index/img/wechat.png" alt="">
            </p>
            <p class="center">微信</p>
            <label for="check1">
                <img src="/static/index/img/not-check.png" alt="">
            </label>
            <input type="radio" id="check1">
        </div>
        <div class="news">
            <p>姓名：{:substrCut($user.wechat_name)}</p>
        </div>
    </li>
    <li data-type="{if $user.bank_name && $user.bank_open && $user.bank_account_name && $user.bank_number}银行卡{/if}">
        <div class="top">
            <p class="flex-center">
                <img src="/static/index/img/bank.png" alt="">
            </p>
            <p class="center">银行卡</p>
            <label for="check2">
                <img src="/static/index/img/not-check.png" alt="">
            </label>
            <input type="radio" id="check2">
        </div>
        <div class="news">
            <p>银行：{$user.bank_name?:'未绑定'}</p>
            <p>卡号：{:strreplace($user.bank_number)}</p>
        </div>
    </li>
</ul>

<p class="save save-fixed upd-save payment">管理收款方式</p>
</body>
{include file="public/footer"/}
<script>
    $('.draw-to-list li').click(function () {
        $(this).find('label img').attr('src', '/static/index/img/icon2.png')
        $(this).siblings().find('label img').attr('src', '/static/index/img/not-check.png')
        var type = $(this).attr('data-type');
        switch (type) {
            case "支付宝":
                parent.renderLoad(type,'/static/index/img/alipay.png','支付宝（{:substrCut($user.alipay_name)}）')
                break;
            case "微信":
                parent.renderLoad(type,'/static/index/img/wechat.png','微信（{:substrCut($user.wechat_name)}）')
                break;
            case "银行卡":
                parent.renderLoad(type,'/static/index/img/bank.png','银行卡（{:strreplace($user.bank_number)}）')
                break;
            default:
                layer.msg('请先完善后在使用');
        }

    })
    $('.payment').click(function (){
        parent.location.href='{:url("user/methodList")}';
    });
</script>
</html>